package com.magus.project.yddemo.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * 
 * 
 * @author Zhang JiaWei
 * @date 2018-03-23 15:56
 */
@Configuration
@EnableConfigurationProperties(YDDemoProperties.class)
public class YDDemoConfig {

	@Autowired
	private YDDemoProperties properties;

	@Bean(name = "indicatorMapperDataApi")
	public RestTemplate restTemplate(RestTemplateBuilder builder) {
		return builder.rootUri(properties.getRootUri()).build();
	}

}
